Drop support for GTK_TEST_TOUCHSCREEN
authorMatthias Clasen <mclasen@redhat.com>
Mon, 14 Sep 2020 02:44:32 +0000 (22:44 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 14 Sep 2020 02:44:32 +0000 (22:44 -0400)
This environment variable is undocumented, and you can
just use GTK_DEBUG=touchscreen insead.

gtk/gtkmain.c
gtk/inspector/visual.c

index 8bb10a28ac38af743212d6b8146cdcda2ad4811d..8a9a0b12e80837369451c9a3f0772ca7949ff4ff 100644 (file)
@@ -623,13 +623,8 @@ gtk_set_debug_flags (GtkDebugFlags flags)
 gboolean
 gtk_simulate_touchscreen (void)
 {
-  static int test_touchscreen;
-
-  if (test_touchscreen == 0)
-    test_touchscreen = g_getenv ("GTK_TEST_TOUCHSCREEN") != NULL ? 1 : -1;
-
-  return test_touchscreen > 0 || (gtk_get_debug_flags () & GTK_DEBUG_TOUCHSCREEN) != 0;
- }
+  return (gtk_get_debug_flags () & GTK_DEBUG_TOUCHSCREEN) != 0;
+}
 
 #ifdef G_PLATFORM_WIN32
 #undef gtk_init_check
index aa34b753b8b3e29aba0aad22b24fd23276541f70..7a03df3781fd28f2eefd014fdfc3d42984dc0257 100644 (file)
@@ -919,17 +919,6 @@ init_touchscreen (GtkInspectorVisual *vis)
   gtk_switch_set_active (GTK_SWITCH (vis->touchscreen_switch), (gtk_get_debug_flags () & GTK_DEBUG_TOUCHSCREEN) != 0);
   g_signal_connect (vis->touchscreen_switch, "notify::active",
                     G_CALLBACK (update_touchscreen), NULL);
-
-  if (g_getenv ("GTK_TEST_TOUCHSCREEN") != 0)
-    {
-      GtkWidget *row;
-
-      /* hardcoded, nothing we can do */
-      gtk_switch_set_active (GTK_SWITCH (vis->touchscreen_switch), TRUE);
-      gtk_widget_set_sensitive (vis->touchscreen_switch, FALSE);
-      row = gtk_widget_get_ancestor (vis->touchscreen_switch, GTK_TYPE_LIST_BOX_ROW);
-      gtk_widget_set_tooltip_text (row, _("Setting is hardcoded by GTK_TEST_TOUCHSCREEN"));
-    }
 }
 
 static gboolean